let storage = window.sessionStorage;
const TokenKey = "usertoken";
const userKey = "userInfo";

export function getToken(key = TokenKey) {
  return storage.getItem(key);
}

export function setToken(token, key = TokenKey) {
  return storage.setItem(key, token);
}

export function removeToken(key = TokenKey) {
  return storage.removeItem(key);
}

export function getUserInfo(key = userKey) {
  return storage.getItem(key);
}

export function setUserInfo(userinfo, key = userKey) {
  return storage.setItem(key, userinfo);
}
